<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 800px;
            height: 100px;
            background: blue;
        }

        /* 行内元素margin和padding失效情况 */
        /* 水平方向的margin和padding布局中有效 */
        span {
            margin-left: 50px;
            padding-left: 50px;
            padding-right: 50px;
        }

        /* 垂直方向的margin和padding布局中失效 */
        span {
            margin-top: 50px;
            padding-bottom: 50px;
        }
    </style>
</head>

<body>
    <div></div>
    <span>1</span> <span>2</span> <span>3</span>
    <div></div>
</body>

</html>